package com.yunquan.ohana.entity

import com.yunquan.ohana.utils.ColorData
import com.yunquan.ohana.utils.ColorUtil

data class TaskEntity(
    var id: String? = null,
    var title: String? = null,
    var emoji: String? = null,
    var isRepeat: String? = null,
    var repeatRule: String? = null,
    var startDate: String? = null,
    var reminderTime: String? = null,
    var endDate: String? = null,
    var isLate: String? = null,
    var createTime: String? = null,
    var updateTime: String? = null,
    var type: Int? = null,
    var timeSegment: Int? = null,
    var deleted: Int? = null,
    var status: Double? = null,
    var tasksToRoleVos: List<TasksToRoleVo>? = null,
)

data class TaskEntityVo(
    var id: String? = null,
    var deviceId: String? = null,
    var title: String? = null,
    var emoji: String? = null,
    var isRepeat: String? = null,
    var repeatRule: String? = null,
    var startDate: String? = null,
    var reminderTime: String? = null,
    var endDate: String? = null,
    var isLate: String? = null,
    var createTime: String? = null,
    var updateTime: String? = null,
    var type: Int? = null,
    var timeSegment: Int? = null,
    var deleted: Int? = null,
    var status: Double? = null,
    var deviceRoleDtoList: List<TasksToRoleVo>? = null,
)

data class TasksToRoleVo(
    var id: String? = null,
    var tasksId: String? = null,
    var roleId: String? = null,
    var roleName: String? = null,
    var backgroundColor: String? = null,
    var instanceDate: String? = null,
    var status: Int? = null,
    var type: Int? = null,
) {
    fun getColorData(): ColorData {
        return ColorUtil.getColor(backgroundColor?.toInt() ?: 0)
    }
}

data class TaskFilterDto(
    var completed: Boolean = false,
    var lateChores: Boolean = false,
    var roleList: List<RoleEntity>,
)